package com.itheima.thread;

//测试类
public class ThreadDemo02 {
    public static void main(String[] args) {
        MyThread mt = new MyThread();
        MyThread mt2 = new MyThread("2号线程");

        mt.setName("1号线程");

        mt.start();
        mt2.start();

        for (int i = 0; i < 100; i++) {
            //获取main线程的名称
            System.out.println(Thread.currentThread().getName()+i);
        }
    }
}
